/*
 * @Descripttion: 
 * @version: 
 * @Author: wl
 * @Date: 2020-05-13 13:27:23
 * @LastEditors: wl
 * @LastEditTime: 2020-06-06 17:50:19
 */ 
import axios from '../axios'

/* 
 * 角色管理模块
 */

// 保存
export const save = (data) => {
    return axios({
        url: '/admin/service/sys_role_saveAndUpdate',
        method: 'post',
        data
    })
}
// 删除
export const batchDelete = (data) => {
    return axios({
        url: '/admin/service/DelData',
        method: 'post',
        data
    })
}
// 分页查询
export const findPage = (data) => {
    return axios({
        url: '/admin/service/getARole_List',
        method: 'post',
        data
    })
}
// 查询全部
export const findAll = () => {
    return axios({
        url: '/role/findAll',
        method: 'get'
    })
}
// 查询角色菜单集合
export const findRoleMenus = (params) => {
    return axios({
        url: '/role/findRoleMenus',
        method: 'get',
        params
    })
}
// 保存角色菜单集合
export const saveRoleMenus = (data) => {
    return axios({
        url: '/role/saveRoleMenus',
        method: 'post',
        data
    })
}


// 保存角色权限菜单集合
export const savePerm = (data) => {
    return axios({
        url: '/admin/service/sys_role_saveAndUpdate',
        method: 'post',
        data
    })
}

// /admin/service/sys_meny_getIds

export const getPermIds = (data) => {
    return axios({
        url: '/admin/service/sys_meny_getIds',
        method: 'post',
        data
    })
}

//默认角色 data是传入的参数 这种写法是es6的写法 正常应该是 data：data 这种写法更简单
export const defaultRole_list = (data) => {
    return axios({
        url: '/admin/service/sys_defaultRole_list',
        method: 'post',
        data
    })
}
// sys_meny_defaultGetIds 角色编辑
export const meny_defaultGetIds = (data) => {
    return axios({
        url: '/admin/service/sys_meny_defaultGetIds',
        method: 'post',
        data
    })
}
// 默认角色
// sys_defaultRole_add
export const defaultRole_add = (data) => {
    return axios({
        url: '/admin/service/sys_defaultRole_add',
        method: 'post',
        data
    })
}

